#lang racket


(require "../base/base.rkt")

(require "domain.rkt"
         "surface.rkt")


(provide (struct-out plane-surface)
         plane-object-default
         plane-tangent-default
         plane-normal-default
         plane-binormal-default
         make-plane-surface)


(define-struct (plane-surface surface)
  ()
  #:constructor-name new-plane-surface)

(define (plane-object-default)
  (λ (u v)
    (xyz u v 0)))

(define (plane-tangent-default)
  (λ (u v)
    (list ux uy)))

(define (plane-normal-default)
  (λ (u v)
    uz))

(define (plane-binormal-default)
  surface-binormal)

(define (make-plane-surface)
  (new-plane-surface
   (plane-object-default)
   (plane-tangent-default)
   (plane-normal-default)
   (plane-binormal-default)
   (make-domain 'closed (- 2pi) 'closed 2pi)
   (make-domain 'closed (- 2pi) 'closed 2pi)))